package com.ugoodtech.mdcc.core.service;


import com.ugoodtech.mdcc.core.domain.Photo;
import com.ugoodtech.mdcc.core.service.impl.PhotoNotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.IOException;
import java.util.List;

/**
 * Copyright © 2013 All Rights Reserved, Ugood Technology, Inc.
 */
public interface PhotoService {

    Photo savePhotoFile(byte[] photoBytes, String fileName, Long categoryId) throws IOException;

    Page<Photo> queryFiles(List<String> mimeTypes, List<String> notInMimeTypes, Long categoryId, Pageable pageable, String name, Boolean enabled);

    byte[] getDefaultPhoto(String name) throws IOException;

    byte[] getPhotoBytes(Long photoId) throws IOException;

    byte[] getPhotoThumbnailBytes(Long photoId, int width, int height) throws IOException, PhotoNotFoundException;

    Photo getPhotoById(Long photoId);

    Photo save(Photo photo);


}
